"""
tom体重75.0公斤  name  weight
tom每次跑步体重减少0.5公斤  run
tom每次吃东西体重增加1公斤  eat
"""

class Per:
    def __init__(self, name, weight):
        self.name = name
        self.weight = weight

    def __str__(self):
        return 'my name is : %s,weight is : %.1fkg' % (self.name, self.weight)

    def run(self):
        print('%s like run' % self.name)
        self.weight -= 0.5

    def eat(self):
        print('%s like eat' % self.name)
        self.weight += 1


pre = Per('tom', 75)
pre.run()
pre.eat()
print(pre)

pre_two = Per('city', 45)
pre_two.run()
pre_two.eat()
print(pre_two)